package yh.design.strategy;

import org.junit.jupiter.api.Test;
import yh.design.common.res.APIResult;
import yh.design.model.CashDTO;
import yh.design.strategy.impl.CashPayment;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author: zyh
 * @date: 2025/5/15 16:18
 **/

public class PayStrategy {


    @Resource(name = "cashPayment")
    private IPayment<CashDTO> cashPayment;


    @Test
    public void execPayTest(){
        IPayment<CashDTO> cashPayment = new CashPayment();
        IPayContext payContext = new IPayContext(cashPayment);
        CashDTO cashDTO = new CashDTO();
        APIResult apiResult = payContext.execPay(cashDTO, new BigDecimal("100"));
        System.out.println(apiResult);

    }
}
